package com.tanger.common.sql;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

/**
 * @Description 数据源属性
 * @Author Hchenbin
 * @Date 2022/7/12
 * @Version 1.0
 */
@Component
public class DataResourceProp {

    @Value("${spring.datasource.type}")
    private String type;
    @Value("${spring.datasource.driver-class-name}")
    private String driverClassName;
    @Value("${spring.datasource.url}")
    private String url;
    @Value("${spring.datasource.username}")
    private String username;
    @Value("${spring.datasource.password}")
    private String password;

    public static String dataResourceType;
    public static String driver;
    public static String dataResourceUrl;
    public static String visiUserName;
    public static String visiPassword;


    @PostConstruct
    public void init() {
        dataResourceType = type;
        driver = driverClassName;
        dataResourceUrl = url;
        visiUserName = username;
        visiPassword = password;
    }
}
